# Contributor: Jake Buchholz Göktürk <tomalok@gmail.com>
# Maintainer: Jake Buchholz Göktürk <tomalok@gmail.com>
pkgname=go-md2man
pkgver=2.0.5
pkgrel=0
pkgdesc="Utility to convert markdown to man pages"
options="net"
url="https://github.com/cpuguy83/go-md2man"
arch="all"
license="MIT"
makedepends="go"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/cpuguy83/go-md2man/archive/v$pkgver.tar.gz"

export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

export GOFLAGS="$GOFLAGS -modcacherw"

build() {
	go build

	./go-md2man -in go-md2man.1.md -out go-md2man.1
}

check() {
	grep -q "User Manual" go-md2man.1
}

package() {
	install -Dsm755 go-md2man "$pkgdir"/usr/bin/go-md2man
	install -Dm644 go-md2man.1 "$pkgdir"/usr/share/man/man1/go-md2man.1
}

sha512sums="
a6d17218660cd42ee4cbef6834ad751bbc8fe2b97c2f35604ca049f4794c1b2cbba74b50054fea74a6d86fd5d4ab929148ff6a0a6d33095b4f3319dcd664ecf8  go-md2man-2.0.5.tar.gz
"
